package com.gszyxy.bigdataclass1group3.merchant.service.impl;

import com.gszyxy.bigdataclass1group3.merchant.mapper.MerchantMapper;
import com.gszyxy.bigdataclass1group3.merchant.params.MerchantRequestParams;
import com.gszyxy.bigdataclass1group3.merchant.pojo.Goods;
import com.gszyxy.bigdataclass1group3.merchant.pojo.Merchant;
import com.gszyxy.bigdataclass1group3.merchant.service.MerchantService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Service
public class MerchantServiceImpl implements MerchantService {

    @Resource
    private MerchantMapper merchantMapper;

    @Override
    public int addMerchant(MerchantRequestParams merchantRequestParams) {
        return merchantMapper.addMerchant(merchantRequestParams);
    }

    @Override
    public Merchant findMerchantByName(String mname) {
        return merchantMapper.findMerchantByName(mname);
    }

    @Override
    public Merchant login(MerchantRequestParams merchantRequestParams) {
        return merchantMapper.login(merchantRequestParams);
    }

    @Override
    public int updateMerchant(Merchant merchant) {
        return merchantMapper.updateMerchant(merchant);
    }

    @Override
    public int addGoods(Goods goods) {
        return merchantMapper.addGoods(goods);
    }

    @Override
    public List<Goods> findAllGoods() {
        return merchantMapper.findAllGoods();
    }


    @Override
    public List<Merchant> list() {
        return merchantMapper.list();
    }
}